﻿@model CubicFWNet.Data.SystemManage.Model.Item

@{
    ViewBag.Title = "添加/修改数据字典";
    var category = ViewBag.CategoryItems as IEnumerable<ItemCategory>;
}

<div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title">添加/修改数据字典</h4>
        </div>
        <form class="form-horizontal" id="frmedit" action="@Url.Action("Save", "Item")">
            <div class="modal-body">
                <input type="hidden" class="form-control formId" id="Id" name="Id" value="@Model.Id"/>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="">*@Html.DisplayNameFor(model => model.Name) </label>
                    <div class="col-sm-9">
                        @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Name)
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for=""> @Html.DisplayNameFor(model => model.SortNo) </label>
                    <div class="col-sm-9">
                        @Html.EditorFor(model => model.SortNo, new { htmlAttributes = new { @class = "form-control" } })@Html.ValidationMessageFor(model => model.SortNo)
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for=""> @Html.DisplayNameFor(model => model.Memo) </label>
                    <div class="col-sm-9">
                        @Html.EditorFor(model => model.Memo, new { htmlAttributes = new { @class = "form-control" } })@Html.ValidationMessageFor(model => model.Memo)
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for=""> *@Html.DisplayNameFor(model => model.CategoryId) </label>
                    <div class="col-sm-9">
                        <select class="form-control" type="select" id="CategoryId" name="CategoryId">
                            <option value="">==请选择==</option>
                            @foreach (var item in category)
                            {
                                <option value="@item.Id.ToString()">@item.Name</option>
                            }
                        </select>@Html.ValidationMessageFor(model => model.CategoryId)
                    </div>
                </div>
            </div>
            <div class="modal-footer">              
                <button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
                <button type="button" id="btnSubmit" class="btn btn-primary">保存</button>
            </div>
        </form>
    </div>
</div>
